var user = JSON.parse(localStorage.getItem("currentUser"));
// imgSize.js
//  图片尺寸限制
const imgSize = (file,scale,self,msg) => {
    return new Promise((resolve, reject) => {
      let url = window.URL || window.webkitURL;
      let img = new Image();
      img.onload = function () {
        // 图片比例校验
        let valid = img.width / img.height === scale;
        valid ? resolve() : reject();
      };
      img.src = url.createObjectURL(file);
    }).then(
      () => {
        return file;
      },
      () => {
        self.$message({
            message: msg,
            type: "warning"
          });
        return Promise.reject();
      }
    );
  }
export default {user,imgSize}